package com.hk.config;

import com.hk.interceptor.LogInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

/**
 * @author: dpb
 * @Description
 * @date: 2023/1/6 14:06
 * @Version 1.0
 */
@Configuration
public class WebConfig extends WebMvcConfigurationSupport {

    /**
     * 新加的拦截器一定要注册到这个里面
     * @param registry
     */
    @Override
    protected void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new LogInterceptor());
        super.addInterceptors(registry);
    }

}
